#ifndef MYGRAPHVIEW_H
#define MYGRAPHVIEW_H

#include <QGraphicsView>
#include <QWheelEvent>
#include <QMouseEvent>
#include "meshitem.h"
class MyGraphView : public QGraphicsView
{
    Q_OBJECT
public:
    explicit MyGraphView(QObject *parent = 0);
    MeshItem * selectedItem(){return selected_item;}
    
signals:
    void meshItemSelected(MeshItem *it);

public slots:
protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void wheelEvent(QWheelEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

private:
    bool pan_;
    int  pan_start_x_, pan_start_y_;
    MeshItem *selected_item;
    
};

#endif // MYGRAPHVIEW_H
